package com.xmy.cultivate.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.xmy.cultivate.converter.LocalDateConverter;
import com.xmy.cultivate.converter.LocalDateTimeConverter;
import com.xmy.cultivate.enums.ReachTypeEnum;
import com.xmy.cultivate.enums.StatusRecordEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import org.checkerframework.checker.units.qual.A;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 记上课
 * </p>
 *
 * @author min
 * @since 2022-08-11
 */
@TableName("record_course")
@Data
@ApiModel("课程记录实体")
public class RecordCourse implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    @ApiModelProperty("编号")
    private Long id;

    @ExcelIgnore
    @ApiModelProperty("排课信息id")
    private Long schedulingDetailId;

    @ExcelIgnore
    private Integer lessonNum;

    /**
     * 校区id
     */
    @ExcelIgnore
    @ApiModelProperty("校区id")
    private Long schoolId;

    @ExcelProperty(index = 7,value = "上课校区")
    @ApiModelProperty("校区名")
    private String schoolName;

    @ExcelIgnore
    @ApiModelProperty("学生所在班级id")
    private Long oldGradeId;

    @ExcelIgnore
    @ApiModelProperty("学生所在班级教师id")
    private Long oldTeacherId;

    /**
     * 班级id
     */
    @ExcelIgnore
    @ApiModelProperty("班级id")
    private Long gradeId;

    @ExcelProperty(index = 3,value = "班级")
    @ApiModelProperty("班级名")
    private String gradeName;

    @ExcelIgnore
    private Integer yearClassId;

    /**
     * 老师id
     */
    @ExcelIgnore
    @ApiModelProperty("老师id")
    private Long teacherId;

    @ExcelProperty(index = 5,value = "上课教师")
    @ApiModelProperty("老师名")
    private String teacherName;


    /**
     * 上课教室id
     */
    @ExcelIgnore
    @ApiModelProperty("教室id")
    private Long classRoomId;

    @ExcelIgnore
    @ApiModelProperty("教室名")
    private String classRoomName;

    /**
     * 学生id
     */
    @ExcelIgnore
    @ApiModelProperty("学生id")
    private Long studentId;

    /**
     * 1精品课，2智能课，3刷题班
     */
    @ExcelIgnore
    private Integer lessonType;

    /**
     * 学生所在班级id
     */
    @ExcelIgnore
    @ApiModelProperty("学员班级表id")
    private Long studentGradeId;

    @ExcelProperty(index = 2,value = "学员姓名")
    @ApiModelProperty("学生名")
    private String studentName;

    /**
     * 科目id
     */
    @ExcelIgnore
    @ApiModelProperty("科目id")
    private Long subjectsId;

    @ExcelIgnore
    @ApiModelProperty("科目名")
    private String subjectsName;

    /**
     * 安排补课信息的结束时间
     */
    @ExcelIgnore
    @ApiModelProperty("安排补课信息的结束时间")
    private LocalDateTime repairEndDateTime;

    /**
     * 上课日期
     */
    @ExcelProperty(index = 0,value = "上课日期",converter = LocalDateConverter.class)
    @ApiModelProperty("上课日期")
    private LocalDate schoolDate;

    @ExcelIgnore
    @ApiModelProperty("原来的上课日期（如调课前的日期，用来做缺课使用）")
    private LocalDate oldSchoolDate;

    /**
     * 上课开始时间
     */
    @ExcelIgnore
    @ApiModelProperty("上课开始时间")
    private String timeStart;

    /**
     * 上课结束时间
     */
    @ExcelIgnore
    @ApiModelProperty("上课结束时间")
    private String timeEnd;

    @ExcelIgnore
    private LocalDateTime startDateTime;

    @ExcelIgnore
    private LocalDateTime endDateTime;

    /**
     * 1到课，2请假，3旷课
     */
    @ExcelIgnore
    private StatusRecordEnum status;

    @ExcelIgnore
    private Integer useLeaveNum;

    @ExcelIgnore
    private Integer isRepair;

    @ExcelIgnore
    private Long repairId;

    /**
     * 被补课的id
     */
    @ExcelIgnore
    private Long byRecordId;

    /**
     * 1排课班级里的学员，2临时学员，3补课学员插班补课学员
     */
    @ExcelIgnore
    private Integer type;

    /**
     * 课程类别：1精品课（正常排课），3补课，4调课，5消课,6缺课补课
     */
    @ExcelIgnore
    private Integer courseType;

    /**
     * 1正常，2迟到
     */
    @ExcelIgnore
    private ReachTypeEnum reachType;

    @ExcelIgnore
    private Long orderDetailId;

    @ExcelIgnore
    private Integer buckleClassHouse;

    /**
     * 是否扣除了课时
     */
    @ExcelIgnore
    private Integer isDeductHouse;

    @ExcelIgnore
    private Integer isDeductMoney;

    @ExcelIgnore
    private String remark;

    /**
     * 扣课时方式，0未知，1自动，2是手动，3满15次后按消课扣课时,4请假超过两次扣除
     */
    @ExcelIgnore
    private Integer deductType;

    @ExcelIgnore
    private BigDecimal buckleClassMoney;

    @ExcelIgnore
    private Integer teacherGetHouse;

    @ExcelIgnore
    private BigDecimal teacherGetMoney;

    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    private Long createdId;

    @ExcelIgnore
    private Long courseId;

    @ExcelProperty(index = 4,value = "所属课程")
    private String courseName;

    @ExcelIgnore
    private Integer yearAndQuarter;

    @ExcelIgnore
    private Integer yearPart;

    @ExcelIgnore
    private Integer quarter;

    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @ExcelIgnore
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedAt;

    @ExcelIgnore
    private LocalDateTime deletedAt;

    @ExcelIgnore
    @TableLogic
    private Integer deleted;

    /**
     * 应到人数
     */
    @ExcelIgnore
    @ApiModelProperty("应到人数")
    @TableField(exist = false)
    private Integer shouldCount;

    /**
     * 实到人数
     */
    @ExcelIgnore
    @ApiModelProperty("实到人数")
    @TableField(exist = false)
    private Integer solidCount;

    /**
     * 请假人数
     */
    @ExcelIgnore
    @ApiModelProperty("请假人数")
    @TableField(exist = false)
    private Integer leaveCount;

    @ExcelIgnore
    @ApiModelProperty("学生数目")
    @TableField(exist = false)
    private Integer studentNumber;

    @ExcelIgnore
    @ApiModelProperty("剩余课时")
    @TableField(exist = false)
    private Integer residueCourseCount;

    @ExcelIgnore
    @ApiModelProperty("性别")
    @TableField(exist = false)
    private Integer sex;

    @ExcelIgnore
    @ApiModelProperty("已消")
    @TableField(exist = false)
    private Integer alreadyClass;

    @ExcelIgnore
    @ApiModelProperty("可发放提成")
    @TableField(exist = false)
    private Integer mayMoney;

    @ExcelIgnore
    @ApiModelProperty("总课次")
    @TableField(exist = false)
    private Integer sumBuckleClassHouse;

    @ExcelIgnore
    @ApiModelProperty("签到时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime inDateTime;

    @ExcelIgnore
    @ApiModelProperty("签退时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime outDateTime;

    @ExcelProperty(index = 1,value = "上课时段")
    @ApiModelProperty("上课时段")
    @TableField(exist = false)
    private String time;

    @ExcelProperty(index = 6,value = "上课类型")
    @ApiModelProperty("上课时段")
    @TableField(exist = false)
    private String courseTypeStr;

    /**
     * 转出班级id(记录转校时自动创建班级是否已经创建)
     */
    @ExcelIgnore
    @TableField(exist = false)
    private Long outId;

    /**
     * 转出校区详情id
     */
    @ExcelIgnore
    @TableField(exist = false)
    private Long changeSchoolDetailId;


    @ExcelIgnore
    @TableField(exist = false)
    private String statusStr;;

    @ExcelIgnore
    @ApiModelProperty("上课老师需要核对，0未核对，1已核对")
    private Integer checkType;

    @ExcelIgnore
    @ApiModelProperty("带班老师需要核对，0未核对，1已核对")
    private Integer takeCheckType;

    @ExcelIgnore
    @ApiModelProperty("班型id")
    @TableField(exist = false)
    private Long courseTypeId;

    @ExcelIgnore
    @ApiModelProperty("调查结果名称，空格拼接")
    @TableField(exist = false)
    private String surveyResultName;

    @ExcelIgnore
    @ApiModelProperty("手机号")
    @TableField(exist = false)
    private String linkmanPhone;

    @ExcelIgnore
    @ApiModelProperty("在校时长")
    @TableField(exist = false)
    private String inSchoolTime;

    @ExcelIgnore
    @ApiModelProperty("学生状态")
    @TableField(exist = false)
    private String inSchoolStatus;

    @ExcelIgnore
    @ApiModelProperty("在校学员")
    @TableField(exist = false)
    private Integer inSchoolCount;

    @ExcelIgnore
    @ApiModelProperty("离校学员")
    @TableField(exist = false)
    private Integer outSchoolCount;

    @ExcelIgnore
    @ApiModelProperty("未到学员")
    @TableField(exist = false)
    private Integer notSchoolCount;

    @ExcelIgnore
    @ApiModelProperty("学生签到id")
    @TableField(exist = false)
    private Long studentSignInId;

    @ExcelIgnore
    @ApiModelProperty("交卷时间")
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime brushDateTime;

}
